import 'package:flutter/material.dart';

class ScaffoldPage1 extends StatefulWidget {
  const ScaffoldPage1({super.key});

  @override
  State<ScaffoldPage1> createState() => _ScaffoldPage1State();
}

class _ScaffoldPage1State extends State<ScaffoldPage1> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(title: Text('BottomNavigatorBar')),
          body: Container(
            child: Text('底部BottomNavigatorBar 测试'),
          ),
          bottomNavigationBar: BottomNavigationBar(
            /// 这个很重要
            type: BottomNavigationBarType.fixed,
            //currentIndex: selectedIndex,
            onTap: (index) {
              setState(() {
                //  selectedIndex = index;
              });
            },
            items: const <BottomNavigationBarItem>[
              BottomNavigationBarItem(
                label: 'F1',
                icon: Icon(Icons.home),
              ),
              BottomNavigationBarItem(
                label: 'F2',
                icon: Icon(Icons.book),
              ),
              BottomNavigationBarItem(
                label: 'F3',
                icon: Icon(Icons.school),
              ),
              BottomNavigationBarItem(
                label: 'F4',
                icon: Icon(Icons.perm_identity),
              ),
            ],
          )),
    );
  }
}
